<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>文章列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="../../css/public.css" media="all"/>
</head>
<body class="childrenBody">
<form class="layui-form linksAdd">
    <div class="layui-form-item">
        <label class="layui-form-label">ID</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input id" readonly placeholder="文章ID"/>
        </div>
    </div>

    <div class="layui-form-item">


        <label class="layui-form-label">文章类型</label>
        <div class="layui-input-block">
            <!--  <input type="text" class="layui-input typeid"  placeholder="请输入文章类型"/>-->
            <select name="productList" id="zcySelect">
            </select>

        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">文章标题</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input title" lay-verify="required" placeholder="请输入文章标题"/>
        </div>
    </div>


    <div class="layui-form-item ">
        <label class="layui-form-label">文章内容</label>
        <div id="editor" id="content" class="layui-input-block"></div>
        <!--<div class="layui-input-block">-->
            <!--<textarea class="layui-textarea content "  name="content" id="news_content"></textarea>-->
        <!--</div>-->
    </div>


    <!-- <div class="layui-form-item">
         <label class="layui-form-label">创建时间</label>
         <div class="layui-input-block">
             <input type="text" class="layui-input createtime"  placeholder=""/>
         </div>
     </div>
     <div class="layui-form-item" >
         <label class="layui-form-label">修改时间</label>
         <div class="layui-input-block">
             <input type="text" class="layui-input updatetime"  placeholder=""/>
         </div>
     </div>-->
    <div class="layui-form-item" style="text-align:center;line-height:50px">
        <button class="layui-btn" style="width: 120px" lay-filter="addLink" lay-submit>提交</button>
    </div>
</form>
<script type="text/javascript" src="../../layui/layui.js"></script>
<script type="text/javascript" src="articelList.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script type="text/javascript" src="../../js/wangEditor.js"></script>

<script>
    var E = window.wangEditor;
    var editor = new E('#editor');
    // 或者 var editor = new E( document.getElementById('editor') )
    editor.customConfig.customUploadImg = function (files, insert) {
        // files 是 input 中选中的文件列表
        // insert 是获取图片 url 后，插入到编辑器的方法

        // 上传代码返回结果之后，将图片插入到编辑器中
        var formData = new FormData();
        formData.append("file", files[0]);
        $.ajax({
            url: public_url + 'public/?service=App.' + 'Examples_Upload' + '.Go',
            type: 'POST',
            data: formData,
            processData: false,
            contentType: false,
            success: function (data) {

                insert(data.data.url)
            },
            error: function (data) {
                console.log(data)
            }
        });
    };
    editor.create();

    function create_edis(valu) {
        editor.txt.html(valu)
    }

</script>
</body>
</html>